<?php
!defined("EW_ROOT") && exit('No direct script access allowed');
/**
* Ecommerce Web Content Management System
* @copyright (c) 2011 ewcms team http://www.ewcms.org
* @license  GNU GENERAL PUBLIC LICENSE (GPLv3)
* @author iceweb
*/
class wsLang
{
	private static $langArr=array();
	
	/**
	 * 设置语言
	 * @param string $lang
	 */
	public static function setLangArr($lang)
	{
		self::$langArr=$lang;
	}
	
	/**
	 * 获取语言内容
	 * @param string $index
	 */
	public static function getLang($index)
	{
		return isset(self::$langArr[$index]) ? self::$langArr[$index] :self::$langArr['system_not_exit_lang'];
	}
	
	/**
	 * 载入语言包文件
	 * @param string $file
	 */
	public static function loadLang($file)
	{
		$filename=LANG_PATH.'/'.setting::getLang().'/'.$file.'Lang.php';
		if(file_exists($filename))
		{
			return $filename;
		}
	}
}
